package com.kksoft.android.xiaoliaobaike;

public class Const {

	public static final int MSG_URL_NOT_FOUND = 0xffff; // url不存在

	public static final int MSG_SERIES_PAGE_RANGE = 0xff00; // 获得页数范围
	public static final int MSG_SERIES_LIST = 0xff01; // 系列漫画数据
	public static final int MSG_SERIES_FETCH_START = 0xff02; // 开始获取数据
	public static final int MSG_SERIES_FETCH_FINISH = 0xff03; // 获取数据完成
	public static final int MSG_SERIES_FETCH_ERROR = 0xff04; // 获取数据出错
	public static final int MSG_SERIES_ANALYSIS_START = 0xff05; // 开始解析数据
	public static final int MSG_SERIES_ANALYSIS_FINISH = 0xff06; // 解析数据完成
	public static final int MSG_SERIES_ANALYSIS_ERROR = 0xff07; // 解析数据失败

	public static final int MSG_ARTICLE_PAGE_RANGE = 0xff10; // 获得页数范围
	public static final int MSG_ARTICLE_LIST = 0xff11; // 系列漫画数据
	public static final int MSG_ARTICLE_FETCH_START = 0xff12; // 开始获取数据
	public static final int MSG_ARTICLE_FETCH_FINISH = 0xff13; // 获取数据完成
	public static final int MSG_ARTICLE_FETCH_ERROR = 0xff14; // 获取数据出错
	public static final int MSG_ARTICLE_ANALYSIS_START = 0xff15; // 开始解析数据
	public static final int MSG_ARTICLE_ANALYSIS_FINISH = 0xff16; // 解析数据完成
	public static final int MSG_ARTICLE_ANALYSIS_ERROR = 0xff17; // 解析数据失败

	public static final String SERIES_LIST_URL = "http://xiaoliaobaike.com/groups/13/children?page=PAGE";
	public static final String ARTICLE_LIST_URL = "http://xiaoliaobaike.com/groups/SERIES_ID/latest/page/PAGE";
	public static final String BASE_URL = "http://xiaoliaobaike.com";

	public static final String DB_NAME = "xiao_liao_bai_ke.db";

	public static final int POOL_SIZE = 2;

	public static final String BROADCAST_MSG_FETCH_START = "com.kksoft.android.xiaoliaobaike.BROADCAST_MSG_FETCH_START";
	public static final String BROADCAST_MSG_FETCH_FINISH = "com.kksoft.android.xiaoliaobaike.BROADCAST_MSG_FETCH_FINISH";

	public static final String FETCH_START_TIME = "FETCH_START_TIME";

	public static final String FETCH_FINISH_TIME = "FETCH_FINISH_TIME";

	public static String getSeriesListUrl(int page) {
		return Const.SERIES_LIST_URL.replace("PAGE", "" + page);
	}

	public static String getArticleListUrl(int seriesId, int page) {
		return Const.ARTICLE_LIST_URL.replace("SERIES_ID", "" + seriesId).replace("PAGE", "" + page);
	}

}